<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../org/jquery.min.js"></script>
    <script src="../org/angular.min.js"></script>
    <script src="../org/angular-ui-router.min.js"></script>
</head>

<body>
       <div>
        <a href="" ui-sref='/home'>首页</a>
        <a href="#/list">列表页</a>
        <div ui-view>你访问的页面不存在</div>
       </div>
    <script>
        var vm = angular.module('vm',['ui.router']);
        vm.config(['$stateProvider','$urlRouterProvider',function($stateProvider,$urlRouterProvider){
             //定义默认路由
             $urlRouterProvider.otherwise('');
             //定义路由规则
             $stateProvider.state('default',{
                 url: '',
                 template: '<h1>默认组件对应模版</h1>'
             })
             .state('home',{
                 url:'/home',
                 template: '<h1>home对应路由模版</h1>'，
                 controller: 'ctrl'
             })
             .state('lists',{
                 url: '/lists',
                 template: '<h1>lists对应路由模版</h1>',
                 controller: ['$scope',function($scope){}]
             })
        }])
        m.controller('ctrl',['$scope','$state',function($scope,$state){
            //定义方法
            $scope.go = function(url){

            }
        }])
    </script>
</body>

</html>